public class Solution1017 {
    public String baseNeg2(int n) {
        int[] f=new int[32];
        while (n!=0){
            if (n>0){
                int t=1,now=0;
                while (n>t){
                    now+=2;
                    t+=(1<<now);
                }
                f[now]++;
                n-=(1<<now);
            }else {
                int t=-2,now=1;
                while (n<t){
                    now+=2;
                    t-=(1<<now);
                }
                f[now]++;
                n+=(1<<now);
            }
        }
        StringBuilder stringBuilder=new StringBuilder();
        int start=0;
        for (int i=31;i>=0;i--){
            if (f[i]==1){
                start=i;
                break;
            }
        }
        for (int i=start;i>=0;i--){
            stringBuilder.append(f[i]);
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(new Solution1017().baseNeg2(2));
    }
}
